<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    14. Longest Common Prefix
   </h1>
   <p>
    Write a function to find the longest common prefix string amongst an array of strings.
   </p>
   <p>
    If there is no common prefix, return an empty string
    <code>
     ""
    </code>
    .
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input: </strong>["flower","flow","flight"]
<strong>Output:</strong> "fl"
</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input: </strong>["dog","racecar","car"]
<strong>Output:</strong> ""
<strong>Explanation:</strong> There is no common prefix among the input strings.
</pre>
   <p>
    <strong>
     Note:
    </strong>
   </p>
   <p>
    All given inputs are in lowercase letters
    <code>
     a-z
    </code>
    .
   </p>
  </div>
  <div>
   <h1 class="question_title">
    14. 最长公共前缀
   </h1>
   <p>
    编写一个函数来查找字符串数组中的最长公共前缀。
   </p>
   <p>
    如果不存在公共前缀，返回空字符串&nbsp;
    <code>
     ""
    </code>
    。
   </p>
   <p>
    <strong>
     示例&nbsp;1:
    </strong>
   </p>
   <pre><strong>输入: </strong>["flower","flow","flight"]
<strong>输出:</strong> "fl"
</pre>
   <p>
    <strong>
     示例&nbsp;2:
    </strong>
   </p>
   <pre><strong>输入: </strong>["dog","racecar","car"]
<strong>输出:</strong> ""
<strong>解释:</strong> 输入不存在公共前缀。
</pre>
   <p>
    <strong>
     说明:
    </strong>
   </p>
   <p>
    所有输入只包含小写字母&nbsp;
    <code>
     a-z
    </code>
    &nbsp;。
   </p>
  </div>
 </body>
</html>